package 类和对象课堂练习;

public class Pet {
    protected String name;
    private int health;
    private int love;
    private String sex;
//    public Pet(){
//        System.out.println("pet的无参构造方法");
//    }

    public Pet(String name, int health, int love, String sex) {
        this.name = name;
        this.health = health;
        this.love = love;
        this.sex = sex;
    }
    public void print(){
        System.out.println("这是一只宠物，名字叫"+name);
        System.out.println("健康值"+health+".可爱度"+this.love);
        System.out.println("性别是"+this.sex);
    }
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getHealth() {
        return health;
    }

    public void setHealth(int health) {
        this.health = health;
    }

    public int getLove() {
        return love;
    }

    public void setLove(int love) {
        this.love = love;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }
}
